{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pandas.tseries.offsets import *\n",
    "from xiao_utils import months_among, f, f1\n",
    "# %matplotlib inline  # 本句用于在页面中直接画出图\n",
    "\n",
    "#下面几句为了能把DataFrame显示完整\n",
    "# pd.set_option('display.max_colwidth', 2000)\n",
    "# pd.set_option('display.max_columns', 500)\n",
    "# pd.set_option('display.max_rows', 200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 20297 entries, 0 to 139\n",
      "Data columns (total 32 columns):\n",
      "TR                       20157 non-null object\n",
      "brand_id                 20297 non-null int64\n",
      "car_height               20157 non-null float64\n",
      "car_length               20157 non-null float64\n",
      "car_width                20157 non-null float64\n",
      "class_id                 20297 non-null int64\n",
      "compartment              20157 non-null float64\n",
      "cylinder_number          20157 non-null float64\n",
      "department_id            20157 non-null float64\n",
      "displacement             20157 non-null float64\n",
      "driven_type_id           20157 non-null float64\n",
      "emission_standards_id    20157 non-null float64\n",
      "engine_torque            20138 non-null float64\n",
      "equipment_quality        20157 non-null float64\n",
      "front_track              20157 non-null float64\n",
      "fuel_type_id             20154 non-null float64\n",
      "gearbox_type             20157 non-null object\n",
      "if_MPV_id                20157 non-null float64\n",
      "if_charging              20157 non-null object\n",
      "if_luxurious_id          20157 non-null float64\n",
      "level_id                 19859 non-null float64\n",
      "newenergy_type_id        20157 non-null float64\n",
      "power                    20157 non-null float64\n",
      "price                    11377 non-null float64\n",
      "price_level              20157 non-null float64\n",
      "rated_passenger          20157 non-null object\n",
      "rear_track               20157 non-null float64\n",
      "sale_date                20297 non-null datetime64[ns]\n",
      "sale_quantity            20157 non-null float64\n",
      "total_quality            20157 non-null float64\n",
      "type_id                  20157 non-null float64\n",
      "wheelbase                20157 non-null float64\n",
      "dtypes: datetime64[ns](1), float64(25), int64(2), object(4)\n",
      "memory usage: 5.1+ MB\n"
     ]
    }
   ],
   "source": [
    "# 将level_id字段中的-替换为np.nan\n",
    "df = pd.read_csv('../../data/origin/[new] yancheng_train_20171226.csv', dtype={'sale_date':str}, na_values=['-'], low_memory=False)\n",
    "df['sale_date']= pd.to_datetime(df['sale_date'], format='%Y%m')\n",
    "\n",
    "# 将price_level字段转换成有序类别的类型，并用其数值填入该列。\n",
    "df['price_level'] = df['price_level'].astype('category', categories=['5WL','5-8W','8-10W','10-15W','15-20W','20-25W','25-35W','35-50W','50-75W'], ordered=True)\n",
    "df['price_level'] = df['price_level'].cat.codes\n",
    "\n",
    "# 待选方案：先把power和扭矩字段带/的行复制一份，然后将新行里的销量清零，将原行和新行的power和扭矩字段的值分别赋为slash前后的值。\n",
    "# 现行方案：先他娘的直接把slash和后面的值删掉。省得影响记录条数相关的统计量。\n",
    "def process_power_and_torque(s):\n",
    "    return s.split('/')[0]\n",
    "df['power'] = df['power'].astype(str).apply(process_power_and_torque).astype(float) #[18600]\n",
    "df['engine_torque'] = df['engine_torque'].astype(str).apply(process_power_and_torque).astype(float)\n",
    "\n",
    "# -------------------------------------------------------------\n",
    "# 把2017年11月的数据拼进来，一块填入其特征，用于最终输出要提交的结果。\n",
    "empty_Nov = pd.read_csv('../../data/origin/yancheng_testA_20171225.csv', dtype={'predict_date':str}, na_values=['-'], low_memory=False)\n",
    "empty_Nov['predict_date']= pd.to_datetime(empty_Nov['predict_date'], format='%Y%m')\n",
    "empty_Nov.rename(columns = {'predict_date': 'sale_date', 'predict_quantity':'sale_quantity'}, inplace = True)\n",
    "\n",
    "\n",
    "# 读取玩了，先不急着拼，先把车型到品牌的映射关系join进来\n",
    "class_to_brand = df[['class_id','brand_id']].groupby(['class_id']).mean().reset_index()\n",
    "empyt_Nov = pd.merge(left=empty_Nov, right=class_to_brand, on='class_id', how='left')\n",
    "empty_Nov['brand_id']= class_to_brand['brand_id']\n",
    "# empty_Nov\n",
    "# class_to_brand\n",
    "\n",
    "# class_to_brand\n",
    "\n",
    "# 读取完了，拼上去\n",
    "df = pd.concat([df, empty_Nov])\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 读入时间特征表\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 综合考虑车型和时间的特征（完整的应有5587行，而不包括十月的应略小于5587条）\n",
    "### 该类型特征的 column name 都以 C_ 开头，意为Class（车型）\n",
    "约定下列特征的 column name 中的数字（即下面这个列表里的 i ）表示所计算特征对应的目标月份距离当前月份的差值，如：\n",
    "\n",
    "某行的 sale_date=201609, 则对该行计算的 som_1 表示 201608 的单月销量\n",
    "\n",
    "1. 过去5年的单月销量【C_som_i，Sale of One Month】\n",
    "2. 过去2个月到过去5年的分别的销量和【C_ssm_i, Sale of Sum of Months】\n",
    "3. 过去5年单月销量的一阶差分【C_fd_i, First Difference】\n",
    "4. 过去5年单月销量的二阶差分【C_sd_i, Second Difference】\n",
    "5. 过去5年单月销量比相应上个月销量的比值（类似于差分，减法换成除法）【C_fr_i, First order Ratio】\n",
    "7. 单月销量二阶比值（即上面第5条特征的相邻月之比）【C_sr_i, Second order Ratio】\n",
    "10. 过去5年各相邻月一阶比值的差分【C_dfr_i, Difference of First-order Ratio】\n",
    "11. 过去5年各相邻月一阶差分的比值【C_rfd_i, Ratio of First-order Difference】\n",
    "\n",
    "8. 【未加入】从去年往前看，过去几年中，当前月的销量占当年销量的比例（本车型的）【C_ry_i, Ratio in Year】\n",
    "2. 【未加入】从去年开始往前看，每年中该车型销量占全年销量的比例【C_rcy_i, Ratio of this Class sale in whole Year sale】\n",
    "\n",
    "1. 过去5年单月车型销量在单月各车型全部销量中的占比【C_rcm_i, Ratio of this Class sale in Month sale】\n",
    "1. 基于这个占比，又有一堆特征：\n",
    "    1. 一阶差分【C_rcm_fd_i, rcm和fd的含义，参考上面的特征描述】\n",
    "    2. 二阶差分【C_rcm_sd_i】\n",
    "    1. 一阶比值【C_rcm_fr_i】\n",
    "    2. 二阶比值【C_rcm_sr_i】\n",
    "    1. 比值的差分【C_rcm_dfr_i】\n",
    "    2. 差分的比值【C_rcm_rfd_i】\n",
    "    \n",
    "1. 相邻年同月的差分【C_fdy, First-order Difference over Year】\n",
    "1. 相邻年同月的比值【C_fry, y 表示 over Year】\n",
    "1. 相邻年同月的二阶差分【C_sdy, y 表示 over Year】\n",
    "1. 相邻年同月的二阶比值【C_sry, y 表示 over Year】\n",
    "1. 相邻年同月的比值的差分【C_dfry, y 表示 over Year】\n",
    "1. 相邻年同月的差分的比值【C_rdfy, y 表示 over Year】"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# tt = df.groupby(['class_id','sale_date']).sum().reset_index()[['class_id','sale_date','sale_quantity']]\n",
    "\n",
    "# g_date = df[['sale_date','sale_quantity']].groupby('sale_date').sum()\n",
    "# g_date = g_date.rename(columns={'sale_quantity':'T_som_0'})\n",
    "\n",
    "# tt['sale_date'].apply(lambda x: g_date.loc[[x]]['T_som_0'])# .reset_index()\n",
    "\n",
    "# g_cls_date = df.groupby(['class_id','sale_date']).sum().reset_index()[['class_id','sale_date','sale_quantity']]\n",
    "# gg = g_cls_date.groupby('class_id')\n",
    "# gg.mean()\n",
    "\n",
    "# g_cls_date\n",
    "\n",
    "\n",
    "\n",
    "# g_date = df[['sale_date','sale_quantity']].groupby('sale_date').sum()\n",
    "# g_date = g_date.rename(columns={'sale_quantity':'T_som_0'})\n",
    "    \n",
    "# ratios = pd.merge(g_cls_date, g_date, how='left', left_on='sale_date', right_index=True)\n",
    "# ratios['C_rcm_0'] = ratios['sale_quantity'] / ratios['T_som_0']\n",
    "    \n",
    "# gg = ratios.groupby('class_id')\n",
    "\n",
    "# gg.apply(f, -(0+1), -0, 'C_rcm_0').reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 主要逻辑\n",
    "def calc_features_on_class_and_time(df):\n",
    "    \"\"\"\n",
    "    Args:\n",
    "        df: 完整的数据集\n",
    "    Return:\n",
    "        tmp：基于综合时间和车型信息，构造出的特征们\n",
    "    \"\"\"\n",
    "    g_cls_date = df.groupby(['class_id','sale_date']).sum().reset_index()[['class_id','sale_date','sale_quantity']]\n",
    "    gg = g_cls_date.groupby('class_id')\n",
    "\n",
    "    # 过去几年内的每个月销量\n",
    "    tmp = g_cls_date\n",
    "    for i in range(62):\n",
    "        tmp['C_som_' + str(i+1)] = gg.apply(f, -(i+1), -i).reset_index()['sale_date']\n",
    "\n",
    "\n",
    "    # 该车型过去2~60个月分别的销量和\n",
    "    tmp['C_ssm_1'] = tmp['C_som_1']\n",
    "    for i in range(60):\n",
    "        tmp['C_ssm_' + str(i+2) ] = tmp['C_ssm_' + str(i+1)] + tmp['C_som_' + str(i+2)]\n",
    "    tmp = tmp.drop('C_ssm_1', axis=1) # 再把这一列删掉，因为和前面的 C_som_1 列是重复的\n",
    "    \n",
    "    # 一阶差分，一阶比值\n",
    "    for i in range(61):\n",
    "        thismonth = tmp['C_som_' + str(i+1)]\n",
    "        lastmonth = tmp['C_som_' + str(i+2)]\n",
    "        tmp['C_fd_' + str(i+1)] = thismonth - lastmonth\n",
    "        tmp['C_fr_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    # 二阶差分\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_fd_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fd_' + str(i+2)]\n",
    "        tmp['C_sd_' + str(i+1)] = thismonth - lastmonth\n",
    "        \n",
    "    # 二阶比值\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_fr_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fr_' + str(i+2)]\n",
    "        tmp['C_sr_' + str(i+1)] = thismonth / lastmonth\n",
    "        \n",
    "    # 比值的差分\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_fr_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fr_' + str(i+2)]\n",
    "        tmp['C_dfr_' + str(i+1)] = thismonth - lastmonth\n",
    "    \n",
    "    # 差分的比值\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_fd_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fd_' + str(i+2)]\n",
    "        tmp['C_rfd_' + str(i+1)] = thismonth / lastmonth\n",
    "        \n",
    "        \n",
    "    # 相邻年，一阶差分，一阶比值\n",
    "    for i in range(4):\n",
    "        thismonth = tmp['C_som_' + str((i+1)*12)] # last year\n",
    "        lastmonth = tmp['C_som_' + str((i+2)*12)]\n",
    "        tmp['C_fdy_' + str(i+1)] = thismonth - lastmonth\n",
    "        tmp['C_fry_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    # 相邻年，二阶差分\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_fdy_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fdy_' + str(i+2)]\n",
    "        tmp['C_sdy_' + str(i+1)] = thismonth - lastmonth\n",
    "        \n",
    "    # 相邻年，二阶比值\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_fry_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fry_' + str(i+2)]\n",
    "        tmp['C_sry_' + str(i+1)] = thismonth / lastmonth\n",
    "        \n",
    "    # 相邻年，比值的差分\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_fry_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fry_' + str(i+2)]\n",
    "        tmp['C_dfry_' + str(i+1)] = thismonth - lastmonth\n",
    "    \n",
    "    # 相邻年，差分的比值\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_fdy_' + str(i+1)]\n",
    "        lastmonth = tmp['C_fdy_' + str(i+2)]\n",
    "        tmp['C_rfdy_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    #================================================================\n",
    "    # 下面准备一下部分车型和品牌的历史各月销量\n",
    "    g_date = df[['sale_date','sale_quantity']].groupby('sale_date').sum()\n",
    "    g_date = g_date.rename(columns={'sale_quantity':'T_som_0'})\n",
    "    \n",
    "    ratios = pd.merge(g_cls_date, g_date, how='left', left_on='sale_date', right_index=True)\n",
    "    ratios['C_rcm_0'] = ratios['sale_quantity'] / ratios['T_som_0']\n",
    "    \n",
    "    gg = ratios.groupby('class_id')\n",
    "    \n",
    "    tmp['C_rcm_0'] = ratios['C_rcm_0']\n",
    "    # 过去几年内的每个月车型销量占比\n",
    "    for i in range(62):\n",
    "        tmp['C_rcm_' + str(i+1)] = gg.apply(f, -(i+1), -i, 'C_rcm_0').reset_index()['sale_date']\n",
    "#         tmp['C_rcm_' + str(i+1)] = tmp['sale_date'].apply(lambda x: g_date[x])\n",
    "    tmp = tmp.drop('C_rcm_0', axis=1)\n",
    "    \n",
    "    # 一阶差分，一阶比值\n",
    "    for i in range(61):\n",
    "        thismonth = tmp['C_rcm_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_' + str(i+2)]\n",
    "        tmp['C_rcm_fd_' + str(i+1)] = thismonth - lastmonth\n",
    "        tmp['C_rcm_fr_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    # 二阶差分\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_rcm_fd_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fd_' + str(i+2)]\n",
    "        tmp['C_rcm_sd_' + str(i+1)] = thismonth - lastmonth\n",
    "        \n",
    "    # 二阶比值\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_rcm_fr_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fr_' + str(i+2)]\n",
    "        tmp['C_rcm_sr_' + str(i+1)] = thismonth / lastmonth\n",
    "        \n",
    "    # 比值的差分\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_rcm_fr_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fr_' + str(i+2)]\n",
    "        tmp['C_rcm_dfr_' + str(i+1)] = thismonth - lastmonth\n",
    "    \n",
    "    # 差分的比值\n",
    "    for i in range(60):\n",
    "        thismonth = tmp['C_rcm_fd_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fd_' + str(i+2)]\n",
    "        tmp['C_rcm_rfd_' + str(i+1)] = thismonth / lastmonth\n",
    "\n",
    "\n",
    "    # 相邻年，一阶差分，一阶比值\n",
    "    for i in range(4):\n",
    "        thismonth = tmp['C_rcm_' + str((i+1)*12)]\n",
    "        lastmonth = tmp['C_rcm_' + str((i+2)*12)]\n",
    "        tmp['C_rcm_fdy_' + str(i+1)] = thismonth - lastmonth\n",
    "        tmp['C_rcm_fry_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    # 相邻年，二阶差分\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_rcm_fdy_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fdy_' + str(i+2)]\n",
    "        tmp['C_rcm_sdy_' + str(i+1)] = thismonth - lastmonth\n",
    "        \n",
    "    # 相邻年，二阶比值\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_rcm_fry_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fry_' + str(i+2)]\n",
    "        tmp['C_rcm_sry_' + str(i+1)] = thismonth / lastmonth\n",
    "        \n",
    "    # 相邻年，比值的差分\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_rcm_fry_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fry_' + str(i+2)]\n",
    "        tmp['C_rcm_dfry_' + str(i+1)] = thismonth - lastmonth\n",
    "    \n",
    "    # 相邻年，差分的比值\n",
    "    for i in range(3):\n",
    "        thismonth = tmp['C_rcm_fdy_' + str(i+1)]\n",
    "        lastmonth = tmp['C_rcm_fdy_' + str(i+2)]\n",
    "        tmp['C_rcm_rfdy_' + str(i+1)] = thismonth / lastmonth\n",
    "    \n",
    "    # 注意要把np.inf替换为空值，在上面算月销量比例时，引入了inf，其实应该作为空值。\n",
    "    # 注意过程中产生的 0 也要都换成空值！因为实际上不可能有有意义的0出现的。\n",
    "    return tmp.replace([np.inf, -np.inf, 0], np.nan)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp = calc_features_on_class_and_time(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>sale_date</th>\n",
       "      <th>sale_quantity</th>\n",
       "      <th>C_som_1</th>\n",
       "      <th>C_som_2</th>\n",
       "      <th>C_som_3</th>\n",
       "      <th>C_som_4</th>\n",
       "      <th>C_som_5</th>\n",
       "      <th>C_som_6</th>\n",
       "      <th>C_som_7</th>\n",
       "      <th>...</th>\n",
       "      <th>C_rcm_sdy_3</th>\n",
       "      <th>C_rcm_sry_1</th>\n",
       "      <th>C_rcm_sry_2</th>\n",
       "      <th>C_rcm_sry_3</th>\n",
       "      <th>C_rcm_dfry_1</th>\n",
       "      <th>C_rcm_dfry_2</th>\n",
       "      <th>C_rcm_dfry_3</th>\n",
       "      <th>C_rcm_rfdy_1</th>\n",
       "      <th>C_rcm_rfdy_2</th>\n",
       "      <th>C_rcm_rfdy_3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-03-01</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-04-01</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-05-01</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-06-01</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-07-01</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-09-01</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-10-01</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>58.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-11-01</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>232.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>103507</td>\n",
       "      <td>2015-12-01</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>226.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-01-01</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>286.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-02-01</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>297.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-03-01</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>355.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-04-01</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>442.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-05-01</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>1050.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-06-01</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>481.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-07-01</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>1433.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-08-01</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>993.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-09-01</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>953.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-10-01</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>650.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-12-01</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>772.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-01-01</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>829.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>378.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-03-01</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>406.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.585928</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-04-01</td>\n",
       "      <td>290.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>684.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.446144</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-05-01</td>\n",
       "      <td>429.0</td>\n",
       "      <td>290.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>632.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.799512</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-06-01</td>\n",
       "      <td>371.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>290.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>876.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.199835</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-07-01</td>\n",
       "      <td>313.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>290.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>1653.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.119344</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>103507</td>\n",
       "      <td>2017-08-01</td>\n",
       "      <td>180.0</td>\n",
       "      <td>313.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>290.0</td>\n",
       "      <td>371.0</td>\n",
       "      <td>435.0</td>\n",
       "      <td>499.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.032759</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5697</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-06-01</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>799.0</td>\n",
       "      <td>800.0</td>\n",
       "      <td>439.0</td>\n",
       "      <td>447.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5698</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-07-01</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>799.0</td>\n",
       "      <td>800.0</td>\n",
       "      <td>439.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5699</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-08-01</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>799.0</td>\n",
       "      <td>800.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5700</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-09-01</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>799.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5701</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-10-01</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>429.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5702</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-11-01</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>260.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5703</th>\n",
       "      <td>978089</td>\n",
       "      <td>2015-12-01</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>418.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5704</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-01-01</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>372.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5705</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-02-01</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>428.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5706</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-03-01</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5707</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-04-01</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>753.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5708</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-05-01</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>790.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5709</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-06-01</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5710</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-07-01</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5711</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-08-01</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>651.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>18.379353</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5712</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-09-01</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>623.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.686375</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5713</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-10-01</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>605.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.120099</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5714</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>604.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.072756</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5715</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-12-01</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>735.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.842030</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5716</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-01-01</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.158241</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5717</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-02-01</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>530.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.107122</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5718</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-03-01</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>521.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.206277</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5719</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-04-01</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>474.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.058641</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5720</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-05-01</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>503.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.441068</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5721</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-06-01</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>400.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.032977</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5722</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-07-01</td>\n",
       "      <td>270.0</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>1042.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.089082</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5723</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-08-01</td>\n",
       "      <td>419.0</td>\n",
       "      <td>270.0</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>558.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000652</td>\n",
       "      <td>0.045203</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-18.503347</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.130741</td>\n",
       "      <td>18.379353</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5724</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-09-01</td>\n",
       "      <td>401.0</td>\n",
       "      <td>419.0</td>\n",
       "      <td>270.0</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>494.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004237</td>\n",
       "      <td>0.141991</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-3.162941</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.653967</td>\n",
       "      <td>2.686375</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5725</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-10-01</td>\n",
       "      <td>400.0</td>\n",
       "      <td>401.0</td>\n",
       "      <td>419.0</td>\n",
       "      <td>270.0</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>548.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.012687</td>\n",
       "      <td>0.597524</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.450813</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-3.084386</td>\n",
       "      <td>0.120099</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5726</th>\n",
       "      <td>978089</td>\n",
       "      <td>2017-11-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>400.0</td>\n",
       "      <td>401.0</td>\n",
       "      <td>419.0</td>\n",
       "      <td>270.0</td>\n",
       "      <td>381.0</td>\n",
       "      <td>512.0</td>\n",
       "      <td>466.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.014796</td>\n",
       "      <td>0.509031</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.455248</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.729223</td>\n",
       "      <td>-0.072756</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5727 rows × 951 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      class_id  sale_date  sale_quantity  C_som_1  C_som_2  C_som_3  C_som_4  \\\n",
       "0       103507 2015-03-01           58.0      NaN      NaN      NaN      NaN   \n",
       "1       103507 2015-04-01          232.0     58.0      NaN      NaN      NaN   \n",
       "2       103507 2015-05-01          226.0    232.0     58.0      NaN      NaN   \n",
       "3       103507 2015-06-01          286.0    226.0    232.0     58.0      NaN   \n",
       "4       103507 2015-07-01          297.0    286.0    226.0    232.0     58.0   \n",
       "5       103507 2015-08-01          355.0    297.0    286.0    226.0    232.0   \n",
       "6       103507 2015-09-01          442.0    355.0    297.0    286.0    226.0   \n",
       "7       103507 2015-10-01         1050.0    442.0    355.0    297.0    286.0   \n",
       "8       103507 2015-11-01          481.0   1050.0    442.0    355.0    297.0   \n",
       "9       103507 2015-12-01         1433.0    481.0   1050.0    442.0    355.0   \n",
       "10      103507 2016-01-01          993.0   1433.0    481.0   1050.0    442.0   \n",
       "11      103507 2016-02-01          953.0    993.0   1433.0    481.0   1050.0   \n",
       "12      103507 2016-03-01          650.0    953.0    993.0   1433.0    481.0   \n",
       "13      103507 2016-04-01          145.0    650.0    953.0    993.0   1433.0   \n",
       "14      103507 2016-05-01          772.0    145.0    650.0    953.0    993.0   \n",
       "15      103507 2016-06-01          829.0    772.0    145.0    650.0    953.0   \n",
       "16      103507 2016-07-01          378.0    829.0    772.0    145.0    650.0   \n",
       "17      103507 2016-08-01          406.0    378.0    829.0    772.0    145.0   \n",
       "18      103507 2016-09-01          684.0    406.0    378.0    829.0    772.0   \n",
       "19      103507 2016-10-01          632.0    684.0    406.0    378.0    829.0   \n",
       "20      103507 2016-11-01          876.0    632.0    684.0    406.0    378.0   \n",
       "21      103507 2016-12-01         1653.0    876.0    632.0    684.0    406.0   \n",
       "22      103507 2017-01-01          499.0   1653.0    876.0    632.0    684.0   \n",
       "23      103507 2017-02-01          435.0    499.0   1653.0    876.0    632.0   \n",
       "24      103507 2017-03-01          371.0    435.0    499.0   1653.0    876.0   \n",
       "25      103507 2017-04-01          290.0    371.0    435.0    499.0   1653.0   \n",
       "26      103507 2017-05-01          429.0    290.0    371.0    435.0    499.0   \n",
       "27      103507 2017-06-01          371.0    429.0    290.0    371.0    435.0   \n",
       "28      103507 2017-07-01          313.0    371.0    429.0    290.0    371.0   \n",
       "29      103507 2017-08-01          180.0    313.0    371.0    429.0    290.0   \n",
       "...        ...        ...            ...      ...      ...      ...      ...   \n",
       "5697    978089 2015-06-01          372.0    418.0    260.0    429.0    799.0   \n",
       "5698    978089 2015-07-01          428.0    372.0    418.0    260.0    429.0   \n",
       "5699    978089 2015-08-01          503.0    428.0    372.0    418.0    260.0   \n",
       "5700    978089 2015-09-01          753.0    503.0    428.0    372.0    418.0   \n",
       "5701    978089 2015-10-01          790.0    753.0    503.0    428.0    372.0   \n",
       "5702    978089 2015-11-01          659.0    790.0    753.0    503.0    428.0   \n",
       "5703    978089 2015-12-01         1284.0    659.0    790.0    753.0    503.0   \n",
       "5704    978089 2016-01-01          651.0   1284.0    659.0    790.0    753.0   \n",
       "5705    978089 2016-02-01          623.0    651.0   1284.0    659.0    790.0   \n",
       "5706    978089 2016-03-01          605.0    623.0    651.0   1284.0    659.0   \n",
       "5707    978089 2016-04-01          604.0    605.0    623.0    651.0   1284.0   \n",
       "5708    978089 2016-05-01          735.0    604.0    605.0    623.0    651.0   \n",
       "5709    978089 2016-06-01          474.0    735.0    604.0    605.0    623.0   \n",
       "5710    978089 2016-07-01          530.0    474.0    735.0    604.0    605.0   \n",
       "5711    978089 2016-08-01          521.0    530.0    474.0    735.0    604.0   \n",
       "5712    978089 2016-09-01          474.0    521.0    530.0    474.0    735.0   \n",
       "5713    978089 2016-10-01          503.0    474.0    521.0    530.0    474.0   \n",
       "5714    978089 2016-11-01          400.0    503.0    474.0    521.0    530.0   \n",
       "5715    978089 2016-12-01         1042.0    400.0    503.0    474.0    521.0   \n",
       "5716    978089 2017-01-01          558.0   1042.0    400.0    503.0    474.0   \n",
       "5717    978089 2017-02-01          494.0    558.0   1042.0    400.0    503.0   \n",
       "5718    978089 2017-03-01          548.0    494.0    558.0   1042.0    400.0   \n",
       "5719    978089 2017-04-01          466.0    548.0    494.0    558.0   1042.0   \n",
       "5720    978089 2017-05-01          512.0    466.0    548.0    494.0    558.0   \n",
       "5721    978089 2017-06-01          381.0    512.0    466.0    548.0    494.0   \n",
       "5722    978089 2017-07-01          270.0    381.0    512.0    466.0    548.0   \n",
       "5723    978089 2017-08-01          419.0    270.0    381.0    512.0    466.0   \n",
       "5724    978089 2017-09-01          401.0    419.0    270.0    381.0    512.0   \n",
       "5725    978089 2017-10-01          400.0    401.0    419.0    270.0    381.0   \n",
       "5726    978089 2017-11-01            NaN    400.0    401.0    419.0    270.0   \n",
       "\n",
       "      C_som_5  C_som_6  C_som_7      ...       C_rcm_sdy_3  C_rcm_sry_1  \\\n",
       "0         NaN      NaN      NaN      ...               NaN          NaN   \n",
       "1         NaN      NaN      NaN      ...               NaN          NaN   \n",
       "2         NaN      NaN      NaN      ...               NaN          NaN   \n",
       "3         NaN      NaN      NaN      ...               NaN          NaN   \n",
       "4         NaN      NaN      NaN      ...               NaN          NaN   \n",
       "5        58.0      NaN      NaN      ...               NaN          NaN   \n",
       "6       232.0     58.0      NaN      ...               NaN          NaN   \n",
       "7       226.0    232.0     58.0      ...               NaN          NaN   \n",
       "8       286.0    226.0    232.0      ...               NaN          NaN   \n",
       "9       297.0    286.0    226.0      ...               NaN          NaN   \n",
       "10      355.0    297.0    286.0      ...               NaN          NaN   \n",
       "11      442.0    355.0    297.0      ...               NaN          NaN   \n",
       "12     1050.0    442.0    355.0      ...               NaN          NaN   \n",
       "13      481.0   1050.0    442.0      ...               NaN          NaN   \n",
       "14     1433.0    481.0   1050.0      ...               NaN          NaN   \n",
       "15      993.0   1433.0    481.0      ...               NaN          NaN   \n",
       "16      953.0    993.0   1433.0      ...               NaN          NaN   \n",
       "17      650.0    953.0    993.0      ...               NaN          NaN   \n",
       "18      145.0    650.0    953.0      ...               NaN          NaN   \n",
       "19      772.0    145.0    650.0      ...               NaN          NaN   \n",
       "20      829.0    772.0    145.0      ...               NaN          NaN   \n",
       "21      378.0    829.0    772.0      ...               NaN          NaN   \n",
       "22      406.0    378.0    829.0      ...               NaN          NaN   \n",
       "23      684.0    406.0    378.0      ...               NaN          NaN   \n",
       "24      632.0    684.0    406.0      ...               NaN          NaN   \n",
       "25      876.0    632.0    684.0      ...               NaN          NaN   \n",
       "26     1653.0    876.0    632.0      ...               NaN          NaN   \n",
       "27      499.0   1653.0    876.0      ...               NaN          NaN   \n",
       "28      435.0    499.0   1653.0      ...               NaN          NaN   \n",
       "29      371.0    435.0    499.0      ...               NaN          NaN   \n",
       "...       ...      ...      ...      ...               ...          ...   \n",
       "5697    800.0    439.0    447.0      ...               NaN          NaN   \n",
       "5698    799.0    800.0    439.0      ...               NaN          NaN   \n",
       "5699    429.0    799.0    800.0      ...               NaN          NaN   \n",
       "5700    260.0    429.0    799.0      ...               NaN          NaN   \n",
       "5701    418.0    260.0    429.0      ...               NaN          NaN   \n",
       "5702    372.0    418.0    260.0      ...               NaN          NaN   \n",
       "5703    428.0    372.0    418.0      ...               NaN          NaN   \n",
       "5704    503.0    428.0    372.0      ...               NaN          NaN   \n",
       "5705    753.0    503.0    428.0      ...               NaN          NaN   \n",
       "5706    790.0    753.0    503.0      ...               NaN          NaN   \n",
       "5707    659.0    790.0    753.0      ...               NaN          NaN   \n",
       "5708   1284.0    659.0    790.0      ...               NaN          NaN   \n",
       "5709    651.0   1284.0    659.0      ...               NaN          NaN   \n",
       "5710    623.0    651.0   1284.0      ...               NaN          NaN   \n",
       "5711    605.0    623.0    651.0      ...               NaN          NaN   \n",
       "5712    604.0    605.0    623.0      ...               NaN          NaN   \n",
       "5713    735.0    604.0    605.0      ...               NaN          NaN   \n",
       "5714    474.0    735.0    604.0      ...               NaN          NaN   \n",
       "5715    530.0    474.0    735.0      ...               NaN          NaN   \n",
       "5716    521.0    530.0    474.0      ...               NaN          NaN   \n",
       "5717    474.0    521.0    530.0      ...               NaN          NaN   \n",
       "5718    503.0    474.0    521.0      ...               NaN          NaN   \n",
       "5719    400.0    503.0    474.0      ...               NaN          NaN   \n",
       "5720   1042.0    400.0    503.0      ...               NaN          NaN   \n",
       "5721    558.0   1042.0    400.0      ...               NaN          NaN   \n",
       "5722    494.0    558.0   1042.0      ...               NaN          NaN   \n",
       "5723    548.0    494.0    558.0      ...          0.000652     0.045203   \n",
       "5724    466.0    548.0    494.0      ...          0.004237     0.141991   \n",
       "5725    512.0    466.0    548.0      ...          0.012687     0.597524   \n",
       "5726    381.0    512.0    466.0      ...          0.014796     0.509031   \n",
       "\n",
       "      C_rcm_sry_2  C_rcm_sry_3  C_rcm_dfry_1  C_rcm_dfry_2  C_rcm_dfry_3  \\\n",
       "0             NaN          NaN           NaN           NaN           NaN   \n",
       "1             NaN          NaN           NaN           NaN           NaN   \n",
       "2             NaN          NaN           NaN           NaN           NaN   \n",
       "3             NaN          NaN           NaN           NaN           NaN   \n",
       "4             NaN          NaN           NaN           NaN           NaN   \n",
       "5             NaN          NaN           NaN           NaN           NaN   \n",
       "6             NaN          NaN           NaN           NaN           NaN   \n",
       "7             NaN          NaN           NaN           NaN           NaN   \n",
       "8             NaN          NaN           NaN           NaN           NaN   \n",
       "9             NaN          NaN           NaN           NaN           NaN   \n",
       "10            NaN          NaN           NaN           NaN           NaN   \n",
       "11            NaN          NaN           NaN           NaN           NaN   \n",
       "12            NaN          NaN           NaN           NaN           NaN   \n",
       "13            NaN          NaN           NaN           NaN           NaN   \n",
       "14            NaN          NaN           NaN           NaN           NaN   \n",
       "15            NaN          NaN           NaN           NaN           NaN   \n",
       "16            NaN          NaN           NaN           NaN           NaN   \n",
       "17            NaN          NaN           NaN           NaN           NaN   \n",
       "18            NaN          NaN           NaN           NaN           NaN   \n",
       "19            NaN          NaN           NaN           NaN           NaN   \n",
       "20            NaN          NaN           NaN           NaN           NaN   \n",
       "21            NaN          NaN           NaN           NaN           NaN   \n",
       "22            NaN          NaN           NaN           NaN           NaN   \n",
       "23            NaN          NaN           NaN           NaN           NaN   \n",
       "24            NaN          NaN           NaN           NaN           NaN   \n",
       "25            NaN          NaN           NaN           NaN           NaN   \n",
       "26            NaN          NaN           NaN           NaN           NaN   \n",
       "27            NaN          NaN           NaN           NaN           NaN   \n",
       "28            NaN          NaN           NaN           NaN           NaN   \n",
       "29            NaN          NaN           NaN           NaN           NaN   \n",
       "...           ...          ...           ...           ...           ...   \n",
       "5697          NaN          NaN           NaN           NaN           NaN   \n",
       "5698          NaN          NaN           NaN           NaN           NaN   \n",
       "5699          NaN          NaN           NaN           NaN           NaN   \n",
       "5700          NaN          NaN           NaN           NaN           NaN   \n",
       "5701          NaN          NaN           NaN           NaN           NaN   \n",
       "5702          NaN          NaN           NaN           NaN           NaN   \n",
       "5703          NaN          NaN           NaN           NaN           NaN   \n",
       "5704          NaN          NaN           NaN           NaN           NaN   \n",
       "5705          NaN          NaN           NaN           NaN           NaN   \n",
       "5706          NaN          NaN           NaN           NaN           NaN   \n",
       "5707          NaN          NaN           NaN           NaN           NaN   \n",
       "5708          NaN          NaN           NaN           NaN           NaN   \n",
       "5709          NaN          NaN           NaN           NaN           NaN   \n",
       "5710          NaN          NaN           NaN           NaN           NaN   \n",
       "5711          NaN          NaN           NaN           NaN           NaN   \n",
       "5712          NaN          NaN           NaN           NaN           NaN   \n",
       "5713          NaN          NaN           NaN           NaN           NaN   \n",
       "5714          NaN          NaN           NaN           NaN           NaN   \n",
       "5715          NaN          NaN           NaN           NaN           NaN   \n",
       "5716          NaN          NaN           NaN           NaN           NaN   \n",
       "5717          NaN          NaN           NaN           NaN           NaN   \n",
       "5718          NaN          NaN           NaN           NaN           NaN   \n",
       "5719          NaN          NaN           NaN           NaN           NaN   \n",
       "5720          NaN          NaN           NaN           NaN           NaN   \n",
       "5721          NaN          NaN           NaN           NaN           NaN   \n",
       "5722          NaN          NaN           NaN           NaN           NaN   \n",
       "5723          NaN          NaN    -18.503347           NaN           NaN   \n",
       "5724          NaN          NaN     -3.162941           NaN           NaN   \n",
       "5725          NaN          NaN     -0.450813           NaN           NaN   \n",
       "5726          NaN          NaN     -0.455248           NaN           NaN   \n",
       "\n",
       "      C_rcm_rfdy_1  C_rcm_rfdy_2  C_rcm_rfdy_3  \n",
       "0              NaN           NaN           NaN  \n",
       "1              NaN           NaN           NaN  \n",
       "2              NaN           NaN           NaN  \n",
       "3              NaN           NaN           NaN  \n",
       "4              NaN           NaN           NaN  \n",
       "5              NaN           NaN           NaN  \n",
       "6              NaN           NaN           NaN  \n",
       "7              NaN           NaN           NaN  \n",
       "8              NaN           NaN           NaN  \n",
       "9              NaN           NaN           NaN  \n",
       "10             NaN           NaN           NaN  \n",
       "11             NaN           NaN           NaN  \n",
       "12             NaN           NaN           NaN  \n",
       "13             NaN           NaN           NaN  \n",
       "14             NaN           NaN           NaN  \n",
       "15             NaN           NaN           NaN  \n",
       "16             NaN           NaN           NaN  \n",
       "17             NaN           NaN           NaN  \n",
       "18             NaN           NaN           NaN  \n",
       "19             NaN           NaN           NaN  \n",
       "20             NaN           NaN           NaN  \n",
       "21             NaN           NaN           NaN  \n",
       "22             NaN           NaN           NaN  \n",
       "23             NaN           NaN           NaN  \n",
       "24        8.585928           NaN           NaN  \n",
       "25       -0.446144           NaN           NaN  \n",
       "26        1.799512           NaN           NaN  \n",
       "27        1.199835           NaN           NaN  \n",
       "28        0.119344           NaN           NaN  \n",
       "29       -0.032759           NaN           NaN  \n",
       "...            ...           ...           ...  \n",
       "5697           NaN           NaN           NaN  \n",
       "5698           NaN           NaN           NaN  \n",
       "5699           NaN           NaN           NaN  \n",
       "5700           NaN           NaN           NaN  \n",
       "5701           NaN           NaN           NaN  \n",
       "5702           NaN           NaN           NaN  \n",
       "5703           NaN           NaN           NaN  \n",
       "5704           NaN           NaN           NaN  \n",
       "5705           NaN           NaN           NaN  \n",
       "5706           NaN           NaN           NaN  \n",
       "5707           NaN           NaN           NaN  \n",
       "5708           NaN           NaN           NaN  \n",
       "5709           NaN           NaN           NaN  \n",
       "5710           NaN           NaN           NaN  \n",
       "5711     18.379353           NaN           NaN  \n",
       "5712      2.686375           NaN           NaN  \n",
       "5713      0.120099           NaN           NaN  \n",
       "5714     -0.072756           NaN           NaN  \n",
       "5715      0.842030           NaN           NaN  \n",
       "5716     -0.158241           NaN           NaN  \n",
       "5717     -0.107122           NaN           NaN  \n",
       "5718      0.206277           NaN           NaN  \n",
       "5719      1.058641           NaN           NaN  \n",
       "5720      0.441068           NaN           NaN  \n",
       "5721     -0.032977           NaN           NaN  \n",
       "5722      0.089082           NaN           NaN  \n",
       "5723     -0.130741     18.379353           NaN  \n",
       "5724     -0.653967      2.686375           NaN  \n",
       "5725     -3.084386      0.120099           NaN  \n",
       "5726      6.729223     -0.072756           NaN  \n",
       "\n",
       "[5727 rows x 951 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp.to_csv(\"../../data/features/C_features.csv\",index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
